package com.ppt.android.base.utils

import java.util.regex.Pattern

/**
 *
 * @author ZouJiaCai
 * @since 2023/5/13 14:45
 */
object PasswordUtils {
    /**
     * 密码长度8-20 数字+字母，不能为符号
     */
    fun isPassword(str: String): Boolean {
        val regex = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=\\S+$).{6,20}$"
        val pattern = Pattern.compile(regex)
        val matcher = pattern.matcher(str)
        return matcher.matches()
    }
}